package com.samp.base;

/**
 * 主类，是可以访问内部类的私有方法的，直接访问。
 * @author EX-WANWEI001
 *
 */
public class InnerClass {
	
	public void testInnerClassField(){
		InnerClassDemo icd = new InnerClassDemo("cat");
		String innerField = icd.field;
		System.out.println(innerField);
	}
	
	public static void main(String[] args) {
		InnerClass in = new InnerClass();
		in.testInnerClassField();
	}
	
	
	
	private class InnerClassDemo{
		private String field ;
		InnerClassDemo(String field){
			this.field = "ccc"+field;
		}
	}
}

